package cn.codelead;

import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

/**
 * @Author：wwf
 * @Package：PACKAGE_NAME
 * @Project：mcp
 * @name：McpServerApplication
 * @Date：2025/4/10 17:54
 * @Filename：McpServerApplication
 */
@SpringBootApplication
public class McpServerApplication {
    public static void main(String[] args) {
        org.springframework.boot.SpringApplication.run(McpServerApplication.class, args);
    }


    @Bean
    public ToolCallbackProvider weatherTools(MysqlMcpService mysqlMcpService) {
        return MethodToolCallbackProvider.builder()
                .toolObjects(mysqlMcpService).build();
    }
}
